import React, { Component } from "react";
import qs from "querystring";

export default class Detail extends Component {
  render() {
    // 获取params 参数
    // let { params } = this.props.match;

    //接收search参数
    const { search } = this.props.location;
    let params = qs.parse(search.slice(1))

    return (
      <div>
        <ul>
          <li>ID: {params.id}</li>
          <li>TITLE: {params.title}</li>
        </ul>
      </div>
    );
  }
}
